/* Copilot 样式文件 */

/* ===== Copilot 主面板 ===== */
.copilot-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  border-left: 1px solid #e8e8e8;
  overflow: hidden;
}

.copilot-header {
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copilot-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

.copilot-toggle-btn {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 1000;
}

/* ===== 快速操作卡片 ===== */
.quick-actions-section {
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #262626;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quick-action-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.quick-action-text {
  font-size: 12px;
  text-align: center;
  line-height: 1.2;
}

/* ===== 主内容区域 ===== */
.copilot-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.copilot-content .ant-collapse {
  background: transparent;
}

.copilot-content .ant-collapse-item {
  background: #fff;
  margin-bottom: 1px;
}

.copilot-content .ant-collapse-header {
  font-weight: 500;
  color: #262626;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 24px;
  color: #8c8c8c;
}

.empty-hint {
  font-size: 12px;
  margin-top: 8px;
}

/* ===== 建议卡片 ===== */
.suggestion-card {
  margin-bottom: 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.suggestion-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.suggestion-icon {
  font-size: 16px;
  color: #1890ff;
}

.suggestion-title {
  font-weight: 500;
  color: #262626;
}

.suggestion-description {
  font-size: 13px;
  color: #595959;
  margin-bottom: 12px;
  line-height: 1.6;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
}

/* ===== 检查清单面板 ===== */
.checklist-panel {
  padding: 0;
}

.checklist-progress {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  margin-bottom: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #fff;
}

.progress-title {
  font-size: 14px;
  font-weight: 500;
}

.progress-value {
  font-size: 16px;
  font-weight: 600;
}

.checklist-list {
  margin: 0;
}

.checklist-list .ant-list-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.checklist-item {
  transition: background-color 0.2s ease;
}

.checklist-item:hover {
  background-color: #fafafa;
}

.checklist-item-content {
  width: 100%;
}

.checklist-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.checklist-item-title {
  font-weight: 500;
  color: #262626;
}

.checklist-item-description {
  font-size: 12px;
  color: #8c8c8c;
  margin: 4px 0;
  line-height: 1.5;
}

.checklist-item-suggestion {
  margin-top: 8px;
  padding: 8px;
  background: #fff7e6;
  border-radius: 4px;
  font-size: 12px;
  color: #595959;
}

.checklist-summary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
}

/* ===== 聊天面板 ===== */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
}

.chat-hints {
  font-size: 13px;
  color: #595959;
  margin: 16px 0 8px;
}

.chat-examples {
  text-align: left;
  font-size: 12px;
  color: #8c8c8c;
  margin: 0;
  padding-left: 20px;
}

.chat-examples li {
  margin-bottom: 4px;
}

.chat-message {
  display: flex;
  margin-bottom: 16px;
  gap: 12px;
}

.chat-message-user {
  flex-direction: row-reverse;
}

.message-avatar {
  flex-shrink: 0;
}

.message-content {
  max-width: 80%;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
}

.chat-message-user .message-bubble {
  background: #1890ff;
  color: #fff;
}

.message-bubble p {
  margin: 0;
  line-height: 1.6;
}

.message-bubble p + p {
  margin-top: 8px;
}

.message-actions {
  margin-top: 4px;
}

.message-time {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #bfbfbf;
}

.message-loading {
  display: flex;
  align-items: center;
}

.chat-input-area {
  padding: 12px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.chat-actions {
  margin-bottom: 8px;
  text-align: right;
}

/* ===== 自动补全弹窗 ===== */
.autocomplete-popup {
  position: fixed;
  z-index: 9999;
  max-width: 400px;
  animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.autocomplete-card {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.autocomplete-card .ant-card-head {
  padding: 8px 12px;
  min-height: auto;
}

.autocomplete-card .ant-card-head-title {
  font-size: 13px;
  padding: 0;
}

.autocomplete-card .ant-card-body {
  padding: 0;
}

.autocomplete-list {
  max-height: 300px;
  overflow-y: auto;
}

.autocomplete-list .ant-list-item {
  padding: 0;
  border: none;
}

.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
  background-color: #f5f5f5;
}

.autocomplete-item-selected {
  background-color: #e6f7ff;
}

.autocomplete-item-content {
  width: 100%;
}

.autocomplete-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.confidence-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.autocomplete-text {
  font-size: 14px;
  color: #262626;
  line-height: 1.5;
  margin-bottom: 4px;
}

.autocomplete-meta {
  font-size: 11px;
}

.autocomplete-footer {
  padding: 8px 12px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

/* ===== 参考资料 ===== */
.references-list {
  padding: 0;
}

.reference-card {
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  transition: all 0.3s ease;
}

.reference-card:hover {
  border-color: #1890ff;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
}

.reference-title {
  font-size: 14px;
  font-weight: 500;
  color: #262626;
  margin-bottom: 8px;
  line-height: 1.4;
}

.reference-summary {
  font-size: 13px;
  color: #595959;
  line-height: 1.6;
  margin-bottom: 8px;
}

.reference-meta {
  margin-bottom: 8px;
  font-size: 12px;
}

.reference-source {
  color: #1890ff;
  font-weight: 500;
}

.reference-credibility,
.reference-relevance {
  color: #8c8c8c;
}

.reference-actions {
  display: flex;
  gap: 8px;
}

/* ===== 响应式样式 ===== */
@media (max-width: 768px) {
  .copilot-panel {
    width: 100%;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }

  .quick-action-card {
    padding: 10px 6px;
  }

  .quick-action-icon {
    font-size: 18px;
  }

  .quick-action-text {
    font-size: 11px;
  }

  .chat-panel {
    height: 300px;
  }

  .message-content {
    max-width: 85%;
  }

  .autocomplete-popup {
    max-width: 90vw;
  }
}

/* ===== 滚动条美化 ===== */
.copilot-content::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.autocomplete-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.copilot-content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.autocomplete-list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.copilot-content::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.autocomplete-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.copilot-content::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.autocomplete-list::-webkit-scrollbar-track {
  background-color: transparent;
}
